<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        @keyframes length {
            0% {
                width: 0;
            }
            100% {
                width: 240px;
            }
        }
        .box {
            height: 20px;
            background-color: aqua;
            font-size: 20px;
            line-height: 20px;
            /* 让我们的文字强制一行内显示 */
            white-space: nowrap;
            overflow: hidden;
            animation: length 5s steps(12) forwards;
        }
    </style>
</head>
<body>
    <div class="box">小熊座流星雨&nbsp;许愿了吗?</div>
</body>
</html>